package nancal.mp.db.es.entity

import nbcp.base.db.annotation.DbEntityGroup
import nbcp.base.db.annotation.DbName
import nbcp.base.model.BaseMarkEntity
import nbcp.myoql.db.comm.DbDefine
import nbcp.myoql.db.comm.DbDefines
import nbcp.myoql.db.es.base.IEsDocument
import java.time.LocalDateTime

@DbName("ngin-log")
@DbEntityGroup("system")
@DbDefines(
    DbDefine(
        "url",
        """{"type":"text","index":"true","analyzer":"ik_max_word","search_analyzer":"ik_max_word"}"""
    ),
    DbDefine(
        "referer",
        """{"type":"text","index":"true","analyzer":"ik_max_word","search_analyzer":"ik_max_word"}"""
    ),
    DbDefine(
        "agent",
        """{"type":"text","index":"true","analyzer":"ik_max_word","search_analyzer":"ik_max_word"}"""
    )
)
class NginxLogIndex : BaseMarkEntity(), IEsDocument {
    var ip: String = ""

    var visitAt: LocalDateTime? = null
    var method: String? = null
    var url: String? = null
    var referer: String? = null
    var status: Int = 0
    var agent: String? = null
}